/*
 * MandelbrotQuadTreeHelpers.h
 *
 *  Created on: 15.07.2012
 *      Author: 116
 */

#include "MandelbrotQuadTree.h"

#ifndef MANDELBROTQUADTREEHELPERS_H_
#define MANDELBROTQUADTREEHELPERS_H_

double getCenterX(MandelbrotQuadTree * node);
double getCenterY(MandelbrotQuadTree * node);

MandelbrotQuadTree * newRoot(double minX, double maxX, double minY, double maxY);

/*
 * splits the node, doing all required assignments and inits
 */
void splitNode(MandelbrotQuadTree * node);

/**
 * returns the depth of the given node
 *
 */
int getNodeDepth(MandelbrotQuadTree * node);

/**
 * return a string containing the path of this node
 *
 * user must free the allocated space
 */
char * getNodePath(MandelbrotQuadTree * node);

/**
 * return a string containing the path of this node
 *
 * user must free the allocated space
 */
char * getShortNodePath(MandelbrotQuadTree * node);

/**
 * shows a node of the QuadTree in a simple way
 */

void show(MandelbrotQuadTree * node);

/**
 * shows a tree as xml
 */
void showXML(MandelbrotQuadTree * node);

/**
 * writes the tree to a file
 *
 * return EXIT_SUCCESS if ok, EXIT_FAILURE if error
 */
int writeXML(MandelbrotQuadTree * node, unsigned int pointsPerSide, unsigned int diffIterLimit, const char * name);

/**
 * computes the size of the tree in memory
 */

unsigned long getSize(MandelbrotQuadTree * node);

#endif /* MANDELBROTQUADTREEHELPERS_H_ */
